<?php
/**
 * Marco Mounzer
 * m.mounzer@gmail.com
 * @copyright 2013
 */
define('APPLICATION_PATH', realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR));
set_include_path(APPLICATION_PATH . PATH_SEPARATOR .
        APPLICATION_PATH . DIRECTORY_SEPARATOR . 'object_database' . PATH_SEPARATOR .
        get_include_path());

require_once 'Database.php';
require_once 'ObjectForm.php';
require_once 'WebUser.php';

try {
    date_default_timezone_set('Europe/Rome');

    if (is_dir('../../tmp/'))
        session_save_path('../../tmp/');

    session_start();

    if (isset($_REQUEST['_price_'])) {
        if (is_numeric($_REQUEST['_price_']))
            $_SESSION['show_price'] = true;
        else
            $_SESSION['show_price'] = false;
    }

    Database::GetIstance()->connect();
} catch (Exception $e) {
    echo $e->getMessage();
    die('Error<pre>' . print_r($e->getTrace(), 1) . '</pre>');
}

$uploaddir = $_SERVER["DOCUMENT_ROOT"] . "/images/cars/";